/**
 * Created by Administrator on 2017/7/29.
 */
$(function () {
    $(function() {
        FastClick.attach(document.body);
    });

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if ( r != null ){
            return decodeURI(r[2]);
        }else{
            return null;
        }
    };
	var name=getQueryString("name");
    var index =getQueryString("id");
    console.log	(name)
    console.log(index);
    var sPatientHGuid=getQueryString("sPatientHGuid");
    var sCollectionBillGuid=getQueryString("index");
    $(".spinner").show();
    
    $(".Hospital-examine>span").text(name);
    $.ajax({
       url:"http://www.jzxchina.cn/M_AjaxData/M_PatientInfoAjax/GetSZCollectionBillValue",
        data:{"sPatientHGuid":sPatientHGuid,"sCollectionBillGuid":sCollectionBillGuid},
        dataType: "JSONP",
        success:function (data) {
            console.log(data);
            var html=template("id",{item:data});
            $(".Hospital-result").html(html);
            $(".spinner").hide();
        }
    });

    $(".icon-zuo").attr("href","historySheet.html?index="+index);
})